package com.ccx.demo.business.user.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.ccx.demo.business.user.entity.TabUser;
import com.support.mvc.encrypt.convert.AesApiIdStringSetJsonConvert;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Set;

/**
 * DTO：用户更新
 * + 定义非空字段校验，原来在属性头上使用 groups 不够灵活，这里通过覆写 get 方法追加非空校验
 * + 定义角色新增时的扩展属性
 *
 * @author 谢长春 on 2022-02-03
 */
@Getter
@Setter
@ToString
public class TabUserUpdateDTO extends TabUser {
    /**
     * 角色加密 id
     */
    @ApiModelProperty(value = "角色加密 id", position = 1)
    @JSONField(serialize = false, deserializeUsing = AesApiIdStringSetJsonConvert.AesIdDeserializer.class)
    public Set<String> roleEncryptIds;

}
